﻿<div class="widget widget-table">
    <div class="widget-header">
        <h3><i class="fa fa-table"></i> 打包管理</h3>
    </div>
    <div class="widget-content">
        <div class="row">
            <div class="col-sm-12" style="padding:0 20px 15px 12px;">
                <button type="button" class="btn btn-primary role" data-role="71" style="margin-left:5px;" ng-click="addPackage('online');">打包登记(线上订单)</button>
                <button type="button" class="btn btn-primary role" data-role="72" style="margin-left:5px;" ng-click="addPackage('offline');">打包登记(线下订单)</button>
            </div>
            <div class="col-sm-12 search-bar">
                <div class="search-col">
                    <label class="search-label">订单状态：</label>
                    <select class="form-control search-control" ng-model="searchBar.orderStatus">
                        <option value="">全部(不包括已删除)</option>
                        <option value="Unpaid">待支付</option>
                        <option value="Paid">已支付</option>
                        <option value="Processing">处理中</option>
                        <option value="Arrears">运费不足</option>
                        <option value="Shipped">已出库</option>
                        <option value="Void">已删除</option>
                    </select>
                </div>
                <div class="search-col">
                    <label class="search-label">导出状态：</label>
                    <select class="form-control search-control" ng-model="searchBar.exportStatus">
                        <option value="">全部(不包括已删除)</option>
                        <option value="UnExported">未导出</option>
                        <option value="Exported">已导出</option>
                    </select>
                </div>
                <div class="search-col">
                    <label class="search-label">发货仓库：</label>
                    <select class="form-control search-control"
                            ng-model="searchBar.warehouseNumber"
                            ng-options="item.warehouseNumber as item.warehouseName for item in searchBar.warehouseList"></select>
                </div>
                <div class="clearfix"></div>
                <div class="search-col">
                    <label class="search-label">搜索条目：</label>
                    <select class="form-control search-control" ng-model="searchBar.keywordType">
                        <option value="customerNumber">客户编号</option>
                        <option value="userName">客户ID</option>
                        <option value="orderNumber">订单编号</option>
                        <option value="trackingNumber">包裹单号</option>
                        <option value="receiveidentity">客户标示</option>
                        <option value="referenceOrderNumber">客户关联号</option>
                        <option value="cnTrackingNumber">国内物流号</option>
                    </select>
                    <input type="text" class="form-control search-control" style="margin-left:5px; width:480px;" placeholder="请输入查询关键字" ng-model="searchBar.keywords" />
                    <button type="button" class="btn btn-primary" style="margin-left:5px;" ng-click="btnSearch()">搜索</button>
                </div>
            </div>
            <div class="col-sm-12 search-bar" ng-show="selectedListCache.length > 0">
                <div class="search-col" style="margin-bottom: 0px;">
                    <label class="search-label">已选择：{{selectedListCache.length}}个订单</label>
                    <button type="button" class="btn btn-link" ng-click="btnClearSelectedListCache();">清除已选项</button>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <table class="table table-bordered">
                    <thead>
                        <tr>
                            <th><input type="checkbox" ng-change="btnSelectedItem()" ng-model="searchBar.selectedAll" /></th>
                            <th>序号</th>
                            <th>订单号</th>
                            <!--<th>订单类型</th>-->
                            <th>客户编号</th>
                            <th>客户关联号</th>
                            <th>包裹跟踪号</th>
                            <th>收货地址</th>
                            <th>包裹重量（磅）</th>
                            <th>打包时间</th>
                            <th>打包人员</th>
                            <th>导出状态</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr ng-repeat="item in dataList">
                            <td><input type="checkbox" ng-change="btnSelectedItem(item)" ng-model="item._selected" /></td>
                            <td>{{item.rownumber}}</td>
                            <td style="max-width: 200px;"><a href="javascript:void(0);" ng-click="btnOpenDetail(item,'orderdetail')">{{item.orderNumber}}</a></td>
                            <!--<td>{{item.orderType == 0 ? '线下订单':'线上订单'}}</td>-->
                            <td><a href="javascript:void(0);" ng-click="btnOpenDetail(item,'customerdetail')">{{item.customerNumber}}</a></td>
                            <td style="max-width: 200px;">{{item.referenceOrderNumber}}</td>
                            <td style="max-width: 150px;"><a href="javascript:void(0);" ng-click="btnOpenDetail(item,'trackingNumber')">{{item.trackingNumber}}</a></td>
                            <td style="max-width: 300px;"><div class="td-row" ng-repeat="ads in item._shipToAddresses">{{ads}}</div></td>
                            <td>{{item.actualWeight}}</td>
                            <td>{{item.lastEditDate | date:'MM/dd/yyyy HH:mm:ss' }}</td>
                            <td>{{item.lastEditUserName}}</td>
                            <td>{{item._exportStatus}}</td>
                            <td>
                                <a href="javascript:void(0)" class="role" data-role="73" ng-click="btnPrint(item,'flyingexpress')">打印翔通面单</a>
                            </td>
                        </tr>
                    </tbody>
                </table>
                <div class="row">
                    <div class="col-sm-6 text-left pull-left">
                        <form style="float:left;" id="form_export_order" method="post" action="/" target="_blank">
                            <input id="orderStatus" name="orderStatus" type="hidden" value="{{exportOptions.orderStatus}}" />
                            <input id="warehouseNumber" name="warehouseNumber" type="hidden" value="{{exportOptions.warehouseNumber}}" />

                            <input id="customerNumber" name="customerNumber" type="hidden" value="{{exportOptions.customerNumber}}" />
                            <input id="userName" name="userName" type="hidden" value="{{exportOptions.userName}}" />
                            <input id="orderNumber" name="orderNumber" type="hidden" value="{{exportOptions.orderNumber}}" />
                            <input id="outBoundTrackingNumber" name="outBoundTrackingNumber" type="hidden" value="{{exportOptions.trackingNumber}}" />
                            <input id="receiveidentity" name="receiveidentity" type="hidden" value="{{exportOptions.receiveidentity}}" />
                            <input id="referenceOrderNumber" name="referenceOrderNumber" type="hidden" value="{{exportOptions.referenceOrderNumber}}" />
                            <input id="cnTrackingNumber" name="cnTrackingNumber" type="hidden" value="{{exportOptions.cnTrackingNumber}}" />
                            <input id="token" name="token" type="hidden" value="{{exportOptions.token}}" />
                            <button type="submit" class="btn btn-primary role" data-role="74">导出订单列表</button>
                        </form>

                        <form style="float:left; margin:0 4px;" id="form_export_send" method="post" action="/" target="_blank">
                            <input id="orderStatus" name="orderStatus" type="hidden" value="{{exportOptions.orderStatus}}" />
                            <input id="warehouseNumber" name="warehouseNumber" type="hidden" value="{{exportOptions.warehouseNumber}}" />

                            <input id="customerNumber" name="customerNumber" type="hidden" value="{{exportOptions.customerNumber}}" />
                            <input id="userName" name="userName" type="hidden" value="{{exportOptions.userName}}" />
                            <input id="orderNumber" name="orderNumber" type="hidden" value="{{exportOptions.orderNumber}}" />
                            <input id="trackingNumber" name="trackingNumber" type="hidden" value="{{exportOptions.trackingNumber}}" />
                            <input id="receiveidentity" name="receiveidentity" type="hidden" value="{{exportOptions.receiveidentity}}" />
                            <input id="referenceOrderNumber" name="referenceOrderNumber" type="hidden" value="{{exportOptions.referenceOrderNumber}}" />
                            <input id="cnTrackingNumber" name="cnTrackingNumber" type="hidden" value="{{exportOptions.cnTrackingNumber}}" />
                            <input id="hasWeight" name="hasWeight" type="hidden" value="true" />
                            <input id="token" name="token" type="hidden" value="{{exportOptions.token}}" />
                            <button type="submit" class="btn btn-primary role" data-role="75">导出发货清单</button>
                        </form>
                        <button style="float:left" type="button" class="btn btn-primary" ng-click="btnBatchOutBound()">批量出库</button>
                        <button style="float:left" id="tip_batchOutbound" type="button" class="btn btn-link btn-help"><i class="fa fa-question-circle"></i></button>
                    </div>
                    <div class="col-sm-6 text-right pull-right">
                        <uib-pagination class="pagination pagination-rewrite pull-right"
                                        boundary-links="true"
                                        max-size="5"
                                        total-items="pagination.totalCount"
                                        items-per-page="pagination.pageSize"
                                        ng-model="pagination.pageIndex"
                                        ng-change="getData()"
                                        previous-text="上一页"
                                        next-text="下一页"
                                        first-text="首页"
                                        last-text="尾页">
                        </uib-pagination>
                        <select class="form-control pull-right" style="width:70px;" ng-model="pagination.pageSize" ng-change="getData()">
                            <option value="10">10</option>
                            <option value="20">20</option>
                            <option value="50">50</option>
                            <option value="100">100</option>
                        </select>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<print-flying-express></print-flying-express>